
             
/**
 * Copyright (c) 2012-2013 JLLT Corp. 2012-2013,All Rights Reserved.
 * This software is published under the 金麟龙腾商贸有限公司.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 *
 * @File name:  DeleteTStoresAction.java   删除【门店信息:T_STORES】
 * @Create on:  2012-08-08 00:56:547
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.ecp.deposit.store.action;

            
import java.sql.Connection;
import java.util.Date;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.po.POUtils;
import cn.boho.framework.service.MessageService;

import com.boho.ecp.constant.Staff;
import com.boho.ecp.constant.Store;
import com.boho.ecp.po.TStoresPO;
            
        

public class DeleteTStoresAction extends ActionImp {
	private TStoresPO conditionTStoresPO = new TStoresPO();
	private TStoresPO valueTStoresPO = new TStoresPO();
	private Date date = new Date();
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1003", MessageService.getMessage("BOHO_COMMON_1003"),"【门店信息】", ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		String updateBy = atx.getStringValue(Staff.STAFF_SESSION_NO);
		conditionTStoresPO.setStoresNo(atx.getIntegerValue("STORES_NO",-1));
		valueTStoresPO.setIsValid(Store.INVALID);
		valueTStoresPO.setUpdateBy(updateBy);
		valueTStoresPO.setUpdateDate(date);
		POUtils.update(con, conditionTStoresPO, valueTStoresPO, false);
		logger.info("删除操作：" + updateBy + "@"+ date + "删除表：【门店信息:T_STORES】 主键【"+ atx.getStringValue("STORES_NO") + "|"+"】");
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		return 1;
	}
}
